package com.xiaoyao.wblog.activity;

import android.app.ListActivity;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.Log;

import com.google.gson.Gson;
import com.tencent.weibo.api.Friends_API;
import com.tencent.weibo.api.Statuses_API;
import com.tencent.weibo.beans.OAuth;
import com.tencent.weibo.utils.WeiBoConst;
import com.xiaoyao.wblog.AppConst;

public class MyFansListActivity extends ListActivity {

	private OAuth mOAuth;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		SharedPreferences settings = getSharedPreferences("token_store", Context.MODE_PRIVATE);
		String oauth_token = settings.getString("oauth_token", null);
		String oauth_token_secret = settings.getString("oauth_token_secret", null);
		mOAuth = new OAuth("Qweibo://OAuthActivity");
		mOAuth.setOauth_token(oauth_token);
		mOAuth.setOauth_token_secret(oauth_token_secret);
		
		Friends_API friends=new Friends_API();
		Statuses_API sapi = new Statuses_API();
		String resultData = "";	
		
		try {
			// 获取主页时间线
			resultData = sapi.home_timeline(mOAuth, WeiBoConst.ResultType.JSON, "0", "0", "20");
			// 获取其他用户听众列表
			//resultData =friends.user_fanslist(mOAuth, WeiBoConst.ResultType.JSON, "10", "0", "xiaoyaosheng86");
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		Gson gson = new Gson();
		
		Log.i(AppConst.TAG_APP_NAME, resultData);
		
	}
}
